#include <iostream>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>

int main() {
    const char* fifoPath = "/tmp/my_fifo";

    // 打开管道以进行写入
    int fd = open(fifoPath, O_WRONLY);
    if (fd < 0) {
        perror("Failed to open FIFO");
        return 1;
    }

    const char* message = "Hello from the client!";
    
    // 向管道中写入数据
    write(fd, message, strlen(message));

    // 关闭管道
    close(fd);

    return 0;
}